package config;

import dao.impl.UserDaoImpl;
import org.springframework.context.annotation.Bean;
import service.UserService;

/**
 * @Author: fancyears·milos·malvis
 * @Description:
 * @Date: Created in  2019/4/22 15:02
 * @Modified By:
 */
//@Configuration
public class BootOutOfConfig {
    public void show(){
        System.out.println("this is BootOutOfConfig");
    }

    @Bean
    /**
     * 调用另一个bean方法即可实现Bean的依赖性
     */
    public UserService getUserService(){
        return new UserService(getUserDao());
    }
    @Bean
    public UserDaoImpl getUserDao(){
        return new UserDaoImpl();
    }
}
